Installation of R, Rtools, and RStudio

2023 ITP-WS2

Author

Prof. Rey R. Cuenca
Math-Stat Dept., MSU-IIT

Downloading the Necessary Executable Files

  1. Open a browser and go to https://posit.co/download/rstudio-desktop.

  1. You will be navigated to the page where the instruction and links for installing R, Rtools, and RStudio are located.

  1. Scroll down and click the DOWNLOAD AND INSTALL R button.

  1. You will be navigated to the RStudio CRAN server.

  1. On the “Download and Install R” pane, click the appropriate system you need. In this demo we choose the Windows option and click “Download R for Windows” linked text.

  1. On the page you are navigated, hold Cntrl on your keyboard and click “base” and “Rtools” links to open on new tabs the pages for the download links necessary in the installation of R and Rtools respectively.

  1. On the “base” page, click the linked text “Download R-4.3.1 for Windows” (the latest version of R at the time of writing this demo).

  1. This will download the executable file for R.

  1. Now, on the “Rtools” page, click on the appropriate Rtools version. Since this demo uses an R version R.4.3.1, we choose “RTools 4.3”.

  1. Clicking on the “RTools 4.3” linked text navigates you to the page where the link to the executable file for Rtools is located. Click the linked text “Rtools43 installer”.

  1. Clicking the linked text “Rtools43 installer” downloads the installer for our necessary Rtools.

  1. Now go back to the page https://posit.co/download/rstudio-desktop and click the DOWNLOAD RSTUDIO DESKTOP FOR WINDOWS button.

  1. Doing Step 12 downloads the executable file for the latest RStudio installer to your local drive.

Installing R

  1. Once we are done downloading the necessary executable files, we first install R by clicking it’s corresponding executable file which in the current demo is R-4.3.1-win.exe .

  1. Clicking the R executable file opens a prompt window asking you to choose what language. In our demo, we choose the default “English” option.

  1. From this point on until Step 6, just accept the defaults by clicking the “Next” button.

  1. Click Next.

  1. Click Next.

  1. Click Next.

  1. For this step where we are instructed to “Select Additional Tasks”, you may opt to accept the default or uncheck some of the checkboxes. In this demo, we will uncheck the two checkboxes under “Additional shortcuts” section and click the Next button.

  1. Now we wait until the Setup Wizard is done installing.

  1. Once the Setup Wizard is done installing, just click the “Finish” button.

Installing Rtools

Important Note: Rtools are only used for those who are using Windows system.

  1. To install Rtools, click the corresponding executable file we have downloaded. In this demo, it is rtools43-5550-5548.exe .

  1. By default, the Setup Wizard will install Rtools in your local drive C: which in this demo have the path C:\rtools43. Just accept this default unless you have a valid reason not to do so (e.g. low drive storage capacity). Now just click the “Next” button.

  1. Accept defaults and click “Next”.

  1. Click “Install”.

  1. Wait until the Setup Wizard finishes the installation.

  1. Click the “Finish” button.

  1. Now navigate to the path where your rtools is installed and copy the path to where the usr/bin folder is located. In this demo, the path is C:\rtools43\usr\bin as shown below. Copy this path. (Note: This path may differ depending on the previous installation you have chosen.)

  1. Now go to your Windows Search Bar. In Windows 11, this is the magnifying glass icon on your Taskbar.

  1. Clicking the magnifying glass icon opens the Windows Search Bar. Now type “edit the system environment variables” and click on the Best match result.

  1. On the pop-up window, click “Environment Variables” somewhere near the lower right.

  1. Clicking on the “Environment Variables” button opens another pop-up window that lists both User and System variables. Under the “System variables” section, click on the variable “Path” (this is indicated as the blue-highlighted portion in the image below). Now click the “Edit” button right below it.

  1. Doing Step 11 opens another pop-up window listing all the Systems Paths you have in your machine. (Warning: Be sure not to delete any this paths unless you know what you are doing.) Now click the button on the upper right portion that says “New”.

  1. This will create a new empty entry at the very bottom of the list of paths. Paste here the path you have copied in Step 7. Once you are done, click the all the OK buttons on all the pop-up windows.

Installing RStudio

IMPORTANT: It is assumed that you have successfully installed R and Rtools at this point. Otherwise, it would be deemed useless proceeding further in installing RStudio.

  1. To install RStudio, click the corresponding executable file. In this demo, it is RStudio-2023.09.0-463.exe.

  1. Starting at this point until the last step, just accept all the defaults. Now, click “Next”.

  1. Click “Next”.

  1. Click “Install”.

  1. Wait until the Setup Wizard is done installing.

  1. Hit the “Finish” button. Now, you are ready to use R via RStudio IDE.